package com.example.jpa.controller;

import com.alibaba.fastjson.JSON;
import com.example.jpa.enums.QueryRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/12/12 18:42
 */
@RestController
@RequestMapping("/enum")
public class EnumTestController
{
    private final Logger log = LoggerFactory.getLogger(this.getClass());

    @GetMapping("/get")
    public QueryRequest testGet(QueryRequest request)
    {
        log.info("【get-request】= {}", JSON.toJSONString(request));
        return request;
    }

    @PostMapping("/post")
    public QueryRequest testPost(@RequestBody QueryRequest request)
    {
        log.info("【post-request】= {}", JSON.toJSONString(request));
        return request;
    }

}
